#ifndef ABOS_INC_MEMLAYOUT_H
#define ABOS_INC_MEMLAYOUT_H

#ifndef __ASSEMBLER__
#include <include/types.h>
#include <include/mmu.h>
#endif /* not __ASSEMBLER__ */


// Global descriptor numbers
#define GD_KT     0x08     // kernel text
#define GD_KD     0x10     // kernel data
#define GD_UT     0x18     // user text
#define GD_UD     0x20     // user data
#define GD_TSS    0x28     // Task segment selector



// At IOPHYSMEM (640K) there is a 384K hole for I/O.  From the kernel,
// IOPHYSMEM can be addressed at KERNBASE + IOPHYSMEM.  The hole ends
// at physical address EXTPHYSMEM.
#define IOPHYSMEM	0x0A0000
#define EXTPHYSMEM	0x100000

// kernel linked and mapped at this address...
#define KERNBASE	0xC0000000
#define KSTACKTOP	KERNBASE
#define KSTKSIZE	(8*PGSIZE)
#define ULIM		(KSTACKTOP-PTSIZE)	
// Top of user-accessible VM
#define UTOP		ULIM
#define UXSTACKTOP	UTOP
#define USTACKTOP	(UTOP-2*PGSIZE)


#ifndef __ASSEMBLER__

struct Page {
	uint16_t pp_ref;
};

#endif /* !__ASSEMBLER__ */
#endif /* !ABOS_INC_MEMLAYOUT_H */
